//
//  UIColor+MB.h
//  MBiOSKit
//
//  Created by catch on 16/9/2.
//  Copyright © 2016年 catch. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 *  RGBA结构体
 */
typedef struct
{
    double r;       // percent [0 - 1]
    double g;       // percent [0 - 1]
    double b;       // percent [0 - 1]
    double a;       // percent [0 - 1]
} RGBA;

/**
 *  HSB结构体
 */
typedef struct
{
    double h;       // angle in degrees [0 - 360]
    double s;       // percent [0 - 1]
    double b;       // percent [0 - 1]
} HSB;

/**
 *  UIColor常用扩展
 */
@interface UIColor (MB)

/**
 *  16进制字符串转换成Color
 *
 *  @param hexString 16进制字符串
 *
 *  @return  UIColor
 */
+ (UIColor *)colorFromHexString:(NSString *)hexString;

/**
 *  HSB转换到RGBA
 *
 *  @param value HSB值
 *
 *  @return RGBA
 */
+(RGBA)RGBfromHSB:(HSB)value;

@end